<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ taglib prefix="authz" uri="http://www.springframework.org/security/tags" %>
<%@ taglib prefix="s" uri="/struts-tags" %>

<script type="text/javascript">

	$(function() {
		// a workaround for a flaw in the demo system (http://dev.jqueryui.com/ticket/4375), ignore!
		$( "#dialog:ui-dialog" ).dialog( "destroy" );
		
		var originalPassword = $( "#originalPassword" ),
			newPassword = $( "#newPassword" ),
			repeatPassword = $( "#repeatPassword" ),
		
			allFields = $( [] ).add( originalPassword ).add( newPassword ).add( repeatPassword ),
			tips = $( ".validateTips" );

		function updateTips( t ) {
			tips
				.text( t )
				.addClass( "ui-state-highlight" );
			setTimeout(function() {
				tips.removeClass( "ui-state-highlight", 1500 );
			}, 500 );
		}


		
		$( "#dialog-form" ).dialog({
			autoOpen: false,
			height: 340,
			width: 300,
			modal: true,
			buttons: {
				"确定": function() {
					var bValid = true;
					allFields.removeClass( "ui-state-error" );

					bValid = bValid && checkLength( originalPassword, "originalPassword", 5, 20 );
					bValid = bValid && checkLength( newPassword, "newPassword", 5, 20 );
					bValid = bValid && checkLength( repeatPassword, "repeatPassword", 5, 20);

					//bValid = bValid && checkRegexp( name, /^[a-z]([0-9a-z_])+$/i, "Username may consist of a-z, 0-9, underscores, begin with a letter." );
					// From jquery.validate.js (by joern), contributed by Scott Gonzalez: http://projects.scottsplayground.com/email_address_validation/
					//bValid = bValid && checkRegexp( email, /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i, "eg. ui@jquery.com" );
					bValid = bValid && checkRegexp( originalPassword, /^([0-9a-zA-Z])+$/, "Password field only allow : a-z 0-9" );
					bValid = bValid && checkRegexp( newPassword, /^([0-9a-zA-Z])+$/, "Password field only allow : a-z 0-9" );
					bValid = bValid && checkRegexp( repeatPassword, /^([0-9a-zA-Z])+$/, "Password field only allow : a-z 0-9" );
					if ( bValid ) {
						
						$( this ).dialog( "close" );
					}
				},
				"取消": function() {
					$( this ).dialog( "close" );
				}
			},
			close: function() {
				allFields.val( "" ).removeClass( "ui-state-error" );
			}
		});
   
        
		$('#changePassword').click(function(){
		 $( "#dialog-form" ).dialog( "open" );
		});
		
		
   
	});
	</script>
	
<div class="ui-layout-north ui-widget-content add-padding">
<div id="logo"><img src="images/logo.jpg" class="img ui-widget-content ui-corner-all" /></div>
<div id="title" class="text ui-widget-content ui-corner-all"><font size="12">非现场审计系统</font></div>
	<div id="radio">

	<a href="quota/first.jsp">指标设置</a>
	<a href="testSitemeshResults">信息收集</a>
	<a href="analysis/first.jsp">信息分析与处理</a>
	<a href="audition/first.jsp">审计报告</a>
	<a href="monitor/first.jsp">后续监督</a>
	<authz:authorize access="hasRole('ROLE_ADMIN')">
	<a href="adminUserManage">应用支撑平台</a>
	</authz:authorize>
	</div>
	<div id="logout">欢迎你:<font color="blue">${sessionScope.chineseName}</font>-<font color="red"><label id="changePassword">修改密码</label></font>-<a href="/hxbankas/j_spring_security_logout"><label>退出系统</label></a></div>
</div> 

<div id="dialog-form" title="修改密码页面">
	<form >
	<fieldset>
<label for="name">修改密码</label><br><br>
              
<label for="originalPassword">原密码</label>
<input type="text" name="originalPassword" id="originalPassword" value="" class="text ui-widget-content ui-corner-all" />
<label for="newPassword">新密码</label>
<input type="text" name="newPassword" id="newPassword" value="" class="text ui-widget-content ui-corner-all" />
<label for="repeatPassword">重复新密码</label>
<input type="text" name="repeatPassword" id="repeatPassword" value="" class="text ui-widget-content ui-corner-all" />
	</fieldset>
	</form>
</div>